package com.demo.javaclient;

import com.demo.thrift.message.MessageService;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TFramedTransport;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;

public class JavaClient {
    public static void main(String [] args) {
        TTransport transport = null;
        try {
            transport = new TSocket("localhost", 9090);
            transport = new TFramedTransport(transport);
            TProtocol protocol = new TBinaryProtocol(transport);
            MessageService.Client client = new MessageService.Client(protocol);

            transport.open();



        } catch (TTransportException e) {
            e.printStackTrace();
        } finally {
            if (null != transport) {
                transport.close();
                transport = null;
            }
        }
    }
}
